<?php 
if (! defined('BASEPATH')) {
	exit('Access Denied');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>后台管理平台---powered by wangjian </title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/<?php echo TEMPLETE_STYLE ;?>/easyui.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/<?php echo TEMPLETE_STYLE ;?>/admin.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/icon.css">
<script type="text/javascript" src="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/menu.js"></script>
<script type="text/javascript" src="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/common.js"></script>
<script>
var _menus = {"menus":[
						{"menuid":"1","icon":"icon-sys","menuname":"系统管理",
							"menus":[
									{"menuid":"12","menuname":"疯狂秀才","icon":"icon-add","url":"http://hxling.cnblogs.com"},
									{"menuid":"13","menuname":"用户管理","icon":"icon-users","url":"demo1.html"},
									{"menuid":"14","menuname":"角色管理","icon":"icon-role","url":"demo2.html"},
									{"menuid":"15","menuname":"权限设置","icon":"icon-set","url":"demo3.html"},
									{"menuid":"16","menuname":"系统日志","icon":"icon-log","url":"demo4.html"},
									{"menuid":"17","menuname":"菜单管理","icon":"icon-log","url":"<?php echo site_url('admin/nav_manager/index/show_nav') ; ?>"}
								]
						},{"menuid":"8","icon":"icon-sys","menuname":"员工管理",
							"menus":[{"menuid":"21","menuname":"员工列表","icon":"icon-nav","url":"demo5.html"},
									{"menuid":"22","menuname":"视频监控","icon":"icon-nav","url":"demo6.html"}
								]
						},{"menuid":"56","icon":"icon-sys","menuname":"部门管理",
							"menus":[{"menuid":"31","menuname":"添加部门","icon":"icon-nav","url":"demo7.html"},
									{"menuid":"32","menuname":"部门列表","icon":"icon-nav","url":"demo8.html"}
								]
						},{"menuid":"28","icon":"icon-sys","menuname":"财务管理",
							"menus":[{"menuid":"41","menuname":"收支分类","icon":"icon-nav","url":"demo9.html"},
									{"menuid":"42","menuname":"报表统计","icon":"icon-nav","url":"demo10.html"},
									{"menuid":"43","menuname":"添加支出","icon":"icon-nav","url":"demo11.html"}
								]
						}
]};
console.dir(_menus);
$(function() {

            openPwd();

            $('#editpass').click(function() {
                $('#w').window('open');
            });

          
			$('#btnCancel').click(function(){closePwd();})

            $('#loginOut').click(function() {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function(r) {

                    if (r) {
                        location.href = '<?php echo site_url('admin/login/login_out') ;?>';
                    }
                });
            })
      });
function openPwd() {
            $('#w').window({
                title: '修改密码',
                width: 300,
                modal: true,
                shadow: true,
                closed: true,
                height: 180,
                resizable:false
            });
        }
        //关闭登录窗口
function closePwd() {
        $('#w').window('close');
}
        //修改密码
function submitForm(){
			//$.messager.progress();
			
			$('#ff').form('submit', {   
				url:'<?php echo site_url('admin/system/index/edit_passwd') ;?>', 
				
			    onSubmit: function(){   
					var isValid = $(this).form('validate');    
					if(isValid){
						var $passwd = $('#passwd').val();
						var $repasswd = $("#repasswd").val();
						
						if($passwd != $repasswd){
							msgShow("系统警告","2次密码不一致","error");
							return false ;
						}else{
							return true ;
						}
					}
					return isValid ;
			    },   
			    success:function(data){  
			    	var data = $.parseJSON(data);
			    	
			    	if(data.resultcode == 0){
			    		msgShow("系统警告",data.resultinfo.errmsg,"error");
			    		return '' ;
				    }else if(data.resultcode>0){
						window.location.href="<?php echo site_url("admin/login/login_out") ;?>";
					}else{
						msgShow("系统信息",data.resultinfo.errmsg,"error");
						return ;
					}
			      
			    }
			    
			}); 				
}	  
</script>	
</head>
<body class="easyui-layout">
    <div region="north" split="true" border="false" style="overflow: hidden; height: 30px;
        background: url(<?php echo base_url() ;?><?php echo APPPATH ;?>/views/<?php echo TEMPLETE_STYLE ;?>/images/layout-browser-hd-bg.gif) #7f99be repeat-x center 50%;
        line-height: 20px;color: #fff; font-family: Verdana, 微软雅黑,黑体">
        <span style="float:right; padding-right:20px;" class="head">欢迎您: <?php echo isset($username)?$username:'' ;?>  | 当前的组是:<?php echo isset($group_name)?$group_name:'' ;?> | <a href="#" id="editpass">修改密码</a> <a href="#" id="loginOut">安全退出</a></span>
        <span style="padding-left:10px; font-size: 16px; "><img src="<?php echo base_url() ;?><?php echo APPPATH ;?>/views/<?php echo TEMPLETE_STYLE ;?>/images/blocks.gif" width="20" height="20" align="absmiddle" />后台管理系统 powered by wangjian</span>
    </div>
	<div data-options="region:'west',split:true,title:'后台菜单导航'" style="width:180%;padding:10px;">
		<div id="nav" class="easyui-accordion" fit="true" border="false">
		<!--  导航内容 -->
				
		</div>
	</div>
	<div data-options="region:'south',border:false" style="height:30px;background:#A9FACD;padding:10px;">
		后台管理平台 powered by 王建
	</div>
	
	<div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden">
        <div id="tabs" class="easyui-tabs"  fit="true" border="false" >
			<div title="欢迎使用" style="padding:10px;overflow:hidden; color:red;background: #eee; " >
				
				<iframe src="<?php echo site_url('admin/index/main') ;?>" frameborder="0"  style="border:none ;width:100%; height:100%"></iframe>

				
			</div>
		</div>
    </div>
	
    <!--修改密码窗口-->
    <div id="w" class="easyui-window" title="修改密码" collapsible="false" minimizable="false"
        maximizable="false" icon="icon-save"  style="width: 300px; height: 150px; padding: 5px;
        background: #fafafa;">
        <div class="easyui-layout" fit="true">
            <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
            <form id="ff" method="post" >
            	<input type="hidden" name="inajax" value="1">
                <table cellpadding=3>
                    <tr>
                        <td>新密码：</td>
                        <td><input class="easyui-validatebox"  id="passwd" type="password" name="passwd" data-options="required:true" validType="length[3,16]" missingMessage="新密码不可以为空" invalidMessage="密码长度必须在6-16位之间"></input></td>
                    </tr>
                    <tr>
                        <td>确认密码：</td>
                        <td><input class="easyui-validatebox"  id="repasswd" type="password" name="repasswd" data-options="required:true" validType="length[3,16]" missingMessage="新密码不可以为空" invalidMessage="密码长度必须在6-16位之间"></input></td>
                    </tr>
                </table>
                </form>
            </div>
            <div region="south" border="false" style="text-align: right; height: 30px; line-height: 24px; margin-top:4px">
                <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" onclick="submitForm()">
             			   确定
				</a> 
				<a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
            </div>
        </div>
    </div>	
	
<div id="mm" class="easyui-menu" style="width:150px;">
		<div id="mm-tabupdate">刷新</div>
		<div class="menu-sep"></div>
		<div id="mm-tabclose">关闭</div>
		<div id="mm-tabcloseall">全部关闭</div>
		<div id="mm-tabcloseother">除此之外全部关闭</div>
		<div class="menu-sep"></div>
		<div id="mm-tabcloseright">当前页右侧全部关闭</div>
		<div id="mm-tabcloseleft">当前页左侧全部关闭</div>
		<div class="menu-sep"></div>
		<div id="mm-exit">退出</div>
</div>	
</body>
</html>